/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React, { Fragment } from "react";
import DocumentTitle from "react-document-title";
import { Icon } from "antd";
import GlobalFooter from "@/components/GlobalFooter";
import styles from "./ArticleLayout.less";
import { connect } from "dva";

const links = [
  {
    key: "help",
    title: "帮助",
    href: "",
  },
  {
    key: "privacy",
    title: "隐私",
    href: "",
  },
  {
    key: "terms",
    title: "条款",
    href: "",
  },
];

@connect(({ setting }) => ({
  ...setting,
}))
class UserLayout extends React.PureComponent {
  render() {
    const { children, options } = this.props;
    const { recordNo, copyright, name } = options;
    const year = new Date().getFullYear();
    return (
      <DocumentTitle title={`帮助文档 - ${name}`}>
        <div className={styles.container}>
          <div className={styles["article-wrap"]}>{children}</div>
          <GlobalFooter
            links={links}
            copyright={
              <Fragment>
                Copyright {<Icon type="copyright" />} {year} {copyright}
              </Fragment>
            }
            recordNo={recordNo}
          />
        </div>
      </DocumentTitle>
    );
  }
}

export default UserLayout;
